package chapter15;

/**
 * @author lzy
 * @version v1.0
 * Create DateTime: 2019/3/14 10:42
 */
class Latte extends Coffee{}

class Mocha extends Coffee{}

class Cappuccino extends Coffee{}

class Americano extends Coffee{}

class Breve extends Coffee{}

public class Coffee {
    private static long counter = 0;
    private final long id = counter++;


    @Override
    public String toString() {
        return getClass().getSimpleName()+"-"+id;
    }
}
